#ifndef __STREAMINGSOUNDDX_H__
#define __STREAMINGSOUNDDX_H__


#pragma once
#include "audio/IStreamingSound.h"
#include "Dsound.h"

namespace directx{

class StreamingSounddx :
	public audio::IStreamingSound
{
public:
	
	StreamingSounddx(const char*, LPDIRECTSOUNDBUFFER8,DWORD);
	StreamingSounddx(void); // Don't use...
	~StreamingSounddx(void);

	virtual void destroy();	
	virtual bool play();
	virtual bool stop();
	virtual bool setVolume(int);

	LPDIRECTSOUNDBUFFER8 getSoundBuffer();
	DWORD getBufferSize();
	const char* getFileName();
	bool getIsPlaying();


private:
	
	//DWORD WINAPI FillBuffer(LPVOID lpParameter)
	DWORD bufferSize;

	const char* fileName;
	LPDIRECTSOUNDBUFFER8 m_lpSB;

	HANDLE hBufferThread;

	bool isPlaying;

};

}

#endif // __STREAMINGSOUNDDX_H__